var DEBUG = true;

/// 判断地理定位
var lat; //精度
var lng; //纬度

var farr = new Array();

window.onload = function() {
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(showPosition);
    } else {
        alert("您的手机不支持地理定位");
    }
}

function showPosition(position) {
    window.lat = position.coords.latitude;
    window.lng = position.coords.longitude;
    getNearbyShop();
}

function getNearbyShop() {
    JKjsonP({
        ws: "customer/getNearbyShop",
        parameter: {
            lat: window.lat,
            lng: window.lng
        },
        sFunc: function(json) {
            if (json.result == "success") {
                alert("获取附近商家成功！");
            } else {
                alert(json.result);
                alert(json.msg);
            }
        },
        eFunc: function(XMLHttpRequest, textStatus, emessage) {
            alert(emessage);
        }
    });
}

/**
 * 获取水果列表，并以ABCD....XYZ分类
 * @param id 商店id
 * @author ciano
 */
function go61(inId) {

    // 获取水果店信息
    JKjsonP({
        ws: "merchants/getShop",
        parameter: {
            id: inId
        },
        sFunc: function(json) {
            if (json.result == "success") {
                var data = json.data;
                if (null != $('#page_6_1_content')) {
                    $('#page_6_1_content').remove();
                }
                $('<div id="page_6_1_content"><p align="center"></p><h3 style="color:#FFFFFF">' + data.shopName + '</h3><p></p><div class="ui-grid-a" style="font-size:14px"><div class="ui-block-a"><p style="color:#FFFFFF">挑:' + data.tGrade + '</p><p style="color:#FFFFFF">距离<span style="color: #900;">未定义</span>米</p><p style="color:#FFFFFF"><span style="color: #900;">未定义优惠信息</span></p></div><div class="ui-block-b"><p style="color:#FFFFFF">速:' + data.sGrade + '</p><p style="color:#FFFFFF">最快<span color="#900“>未定义</span>送达</p><p style="color:#FFFFFF">营业' + data.openTime + '-' + data.closeTime + '</p></div></div></div>')
                    .insertBefore($('#classList61'));
            } else {
                alert(json.msg);
                top.location = "main.html";
            }
        },
        eFunc: function(XMLHttpRequest, textStatus, emessage) {
            JKPprompt("#popup14", emessage);
        }
    });

    // 获取水果列表
    JKjsonP({
        ws: "merchants/listFruitList",
        parameter: {
            shopId: inId
        },
        sFunc: function(json) {
            if (json.result == "success") {
                if (null != DEBUG && DEBUG) {
                    json.data = [{"FruitID":50,"FruitName":"aaa","classID":21,"isImport":"false","Description":"aaa","AddTime":null,"ShopID":19,"isNew":"true","className":"菠萝","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":47,"FruitName":"gh  ","classID":21,"isImport":"true","Description":"adf ","AddTime":null,"ShopID":19,"isNew":"false","className":"菠萝","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":46,"FruitName":"asdasd","classID":21,"isImport":"false","Description":"asdasd","AddTime":null,"ShopID":19,"isNew":"false","className":"菠萝","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":44,"FruitName":"菠萝","classID":21,"isImport":"false","Description":"dcffffffffffffffffffffffdffff更何况好不会反对法国个方法法国哥哥风采vvv 广告法规vg","AddTime":null,"ShopID":19,"isNew":"true","className":"菠萝","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":42,"FruitName":"啊啊啊ddddwwqq","classID":21,"isImport":"true","Description":"阿萨是","AddTime":null,"ShopID":19,"isNew":"false","className":"菠萝","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":41,"FruitName":"脚后跟","classID":21,"isImport":"false","Description":"大送达","AddTime":null,"ShopID":19,"isNew":"false","className":"菠萝","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":32,"FruitName":"xihongshi","classID":21,"isImport":"true","Description":"aaa","AddTime":null,"ShopID":19,"isNew":"true","className":"菠萝","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":31,"FruitName":"aaa","classID":21,"isImport":"false","Description":"111","AddTime":null,"ShopID":19,"isNew":"true","className":"菠萝","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":12,"FruitName":"啊啊啊","classID":21,"isImport":"true","Description":"啊啊","AddTime":null,"ShopID":19,"isNew":"true","className":"菠萝","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":11,"FruitName":"啊啊啊","classID":21,"isImport":"true","Description":"啊啊","AddTime":null,"ShopID":19,"isNew":"true","className":"菠萝","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":9,"FruitName":"啊啊啊","classID":21,"isImport":"false","Description":"","AddTime":null,"ShopID":19,"isNew":"false","className":"菠萝","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":6,"FruitName":"测试 梨","classID":21,"isImport":"false","Description":"得跌快递诶的尅党课id第二开单看到IDD","AddTime":null,"ShopID":19,"isNew":"true","className":"菠萝","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":43,"FruitName":"躬逢盛典发","classID":39,"isImport":"true","Description":"阿斯顿啊","AddTime":null,"ShopID":19,"isNew":"false","className":"芭乐","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":36,"FruitName":"阿萨德阿萨德阿斯 ","classID":39,"isImport":"false","Description":"阿萨德阿斯打算","AddTime":null,"ShopID":19,"isNew":"true","className":"芭乐","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":15,"FruitName":"啊啊啊","classID":39,"isImport":"false","Description":"啊啊","AddTime":null,"ShopID":19,"isNew":"false","className":"芭乐","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":14,"FruitName":"啊啊啊","classID":39,"isImport":"true","Description":"啊啊","AddTime":null,"ShopID":19,"isNew":"true","className":"芭乐","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":13,"FruitName":"啊啊啊","classID":39,"isImport":"false","Description":"啊啊","AddTime":null,"ShopID":19,"isNew":"true","className":"芭乐","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":8,"FruitName":"啊啊啊","classID":39,"isImport":"false","Description":"","AddTime":null,"ShopID":19,"isNew":"false","className":"芭乐","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":7,"FruitName":"啊啊啊","classID":39,"isImport":"false","Description":"","AddTime":null,"ShopID":19,"isNew":"false","className":"芭乐","classMemo":"B","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":48,"FruitName":"dddd","classID":7,"isImport":"false","Description":"fffffff对方提供哈哈刚刚毕业过后刚好红红火火呵呵","AddTime":null,"ShopID":19,"isNew":"true","className":"橙","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":45,"FruitName":"asdasadasdad","classID":7,"isImport":"false","Description":"asdasda","AddTime":null,"ShopID":19,"isNew":"true","className":"橙","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":38,"FruitName":"阿斯达是","classID":7,"isImport":"false","Description":"阿萨德阿斯","AddTime":null,"ShopID":19,"isNew":"false","className":"橙","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":37,"FruitName":"阿萨德阿萨德啊","classID":7,"isImport":"false","Description":"阿萨德阿斯的","AddTime":null,"ShopID":19,"isNew":"true","className":"橙","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":35,"FruitName":"1325687","classID":7,"isImport":"false","Description":"asdads","AddTime":null,"ShopID":19,"isNew":"true","className":"橙","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":34,"FruitName":"dddweqwe","classID":7,"isImport":"false","Description":"asdasd","AddTime":null,"ShopID":19,"isNew":"true","className":"橙","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":33,"FruitName":"pingguo","classID":7,"isImport":"true","Description":"aaa","AddTime":null,"ShopID":19,"isNew":"false","className":"橙","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":29,"FruitName":"111","classID":7,"isImport":"false","Description":"aaa","AddTime":null,"ShopID":19,"isNew":"true","className":"橙","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":28,"FruitName":"111","classID":7,"isImport":"false","Description":"aaa","AddTime":null,"ShopID":19,"isNew":"true","className":"橙","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":27,"FruitName":"111","classID":7,"isImport":"false","Description":"aaa","AddTime":null,"ShopID":19,"isNew":"true","className":"橙","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":16,"FruitName":"啊啊啊啊啊啊","classID":7,"isImport":"false","Description":"啊啊","AddTime":null,"ShopID":19,"isNew":"false","className":"橙","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":39,"FruitName":"阿萨德阿斯的","classID":20,"isImport":"false","Description":"阿萨德阿萨德阿斯","AddTime":null,"ShopID":19,"isNew":"false","className":"草莓","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":30,"FruitName":"aaa","classID":20,"isImport":"true","Description":"aaa","AddTime":null,"ShopID":19,"isNew":"false","className":"草莓","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":10,"FruitName":"啊啊啊","classID":20,"isImport":"false","Description":"","AddTime":null,"ShopID":19,"isNew":"false","className":"草莓","classMemo":"C","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":49,"FruitName":"","classID":12,"isImport":"false","Description":"drgrn","AddTime":null,"ShopID":19,"isNew":"false","className":"番茄","classMemo":"F","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":5,"FruitName":"红富士","classID":12,"isImport":"false","Description":"好吃","AddTime":null,"ShopID":19,"isNew":"true","className":"番茄","classMemo":"F","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":22,"FruitName":"ffffff","classID":9,"isImport":"false","Description":"aaaa","AddTime":null,"ShopID":19,"isNew":"false","className":"瓜果","classMemo":"G","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":40,"FruitName":"cxz","classID":24,"isImport":"false","Description":"安德森","AddTime":null,"ShopID":19,"isNew":"false","className":"桂圆","classMemo":"G","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":26,"FruitName":"aaa","classID":5,"isImport":"a","Description":"111","AddTime":null,"ShopID":19,"isNew":"a","className":"苹果","classMemo":"P","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":25,"FruitName":"aaa","classID":5,"isImport":"a","Description":"111","AddTime":null,"ShopID":19,"isNew":"a","className":"苹果","classMemo":"P","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":24,"FruitName":"aaa","classID":5,"isImport":"a","Description":"111","AddTime":null,"ShopID":19,"isNew":"a","className":"苹果","classMemo":"P","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":23,"FruitName":"aaa","classID":5,"isImport":"a","Descri}]ption":"111","AddTime":null,"ShopID":19,"isNew":"a","className":"苹果","classMemo":"P","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":19,"FruitName":"红富士","classID":5,"isImport":"true","Description":"aaa","AddTime":null,"ShopID":19,"isNew":"true","className":"苹果","classMemo":"P","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":4,"FruitName":"红富士","classID":5,"isImport":"true","Description":"好吃","AddTime":null,"ShopID":19,"isNew":"true","className":"苹果","classMemo":"P","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":3,"FruitName":"红富士","classID":5,"isImport":"true","Description":"好吃","AddTime":null,"ShopID":19,"isNew":"true","className":"苹果","classMemo":"P","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":2,"FruitName":"红富士","classID":5,"isImport":"true","Description":"好吃","AddTime":null,"ShopID":19,"isNew":"true","className":"苹果","classMemo":"P","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":1,"FruitName":"红富士","classID":5,"isImport":"true","Description":"好吃","AddTime":null,"ShopID":19,"isNew":"true","className":"苹果","classMemo":"P","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":20,"FruitName":"aaaaaaaaaaaaaaaaaaaa","classID":19,"isImport":"false","Description":"aaaaaaaaaaaaaa","AddTime":null,"ShopID":19,"isNew":"false","className":"桃","classMemo":"T","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":17,"FruitName":"无花果","classID":41,"isImport":"true","Description":"五花","AddTime":null,"ShopID":19,"isNew":"true","className":"无花果","classMemo":"W","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":21,"FruitName":"bbbb","classID":27,"isImport":"","Description":"","AddTime":null,"ShopID":19,"isNew":"","className":"雪莲果","classMemo":"X","parentID":1,"SEQ":"1","sort":0,"leaf":"1","classLEVEL":1},{"FruitID":18,"FruitName":"菠萝","classID":27,"isImport":"true","Description":"好的","AddTime":null,"ShopID":19,"isNew":"false","className":"雪莲果","classMemo":"X","parentID":1,"SEQ":"1","sort":0,"leaf":1,"classLEVEL":1}];
                }
                var arr61 = json.data;

                for (var i = 0; i < arr61.length; i++) {
                    var obj       = arr61[i];
                    
                    farr.push(obj);
                    
                    var classID   = obj.classID;
                    var className = obj.className;
                    var classMemo = obj.classMemo;
                    
                    if (i == 0) {
                        $('<li ><a id="' + classID + '"  onClick="searchID(this.id)"  class="ui-btn ui-btn-icon-right ui-icon-carat-r">' + className + '</a></li>').insertAfter($("#classlist61" + classMemo));
                        $("#classlist61" + classMemo).css("display", "block");
                    } else if (className != arr61[i - 1].className) {
                        $('<li><a id="' + classID + '"  onClick="searchID(this.id)"   class="ui-btn ui-btn-icon-right ui-icon-carat-r">' + className + '</a></li>').insertAfter($("#classlist61" + classMemo));
                        $("#classlist61" + classMemo).css("display", "block");
                    }
                }
            }
        },
        eFunc: function(XMLHttpRequest, textStatus, emessage) {
            JKPprompt("#popup14", emessage);
        }
    });

    $.mobile.changePage("#page_6_1", {
        transition: "slide"
    });
}

function searchFruitList() {
    JKGetListFruitByIsNew($('#search61').val());
    $.mobile.changePage("#page_4_1", {
        transition: "slide"
    });
}

/**
 * 搜索关键字
 * @param inName 关键字
 * @author ciano
 */
function JKGetListFruitByIsNew(inName) {
    JKjsonP({
        ws: "merchants/searchFruit",
        parameter: {
            name: inName
        },
        sFunc: function(json) {
            if (json.result == "success") {
                var data = json.data;
                for (var i = 0; i < data.length; i++) {
                    var obj = data[i];
                    $('#listview_4_1').append('<li>' + '<a href="#page_7_1" data-transition="slide">' + '<div class="ui-grid-b" style="margin-left:-10px">' + '<div class="ui-block-a" style="margin-top:15px">' + '<p><img id="" src="' + obj.image + '" style="max-width:90px"></p>' + '</div>' + '<div class="ui-block-b" style="width:auto" >' + '<p style="font-size:16px">' + obj.name + '</p>' + '<p>' + obj.shop.shopName + '</p>' + obj.description + '</div>' + '<div class="ui-block-c" style="margin-top:10px;margin-left:-30px" align="right">' + '<p >' + obj.price + '</p>' + '<p style="font-size:12px"><span>挑:' + obj.grade + '</span><span> 速:' + obj.shop.sGrade + '</span></p>' + '<p>' + '' + '</p>' + '</div></div></a></li>');
                }
            }
        },
        eFunc: function(XMLHttpRequest, textStatus, emessage) {
            alert(emessage);
        }
    });
}
function buy82() {
    alert("操作成功");
    $.mobile.changePage("#page_6_2", {
        transition: "slide"
    });

}

function calculate() {
    $("#calculate82").css("display", "block");
}

function buy() {
    alert("加入购物车");
}

/**
 * 检测客户端是否登录了
 * @author ciano
 */
function checkLogin() {
    if (localStorage.getItem("customerId") == null) {
        localStorage.clear();
        return false;
    } else {
        return true;
    }
}

function getOrderDetails(id) {
    localStorage.setItem("order_id", id);
    samePageID('#page_8_3');
    
    $('#page_8_3_listview_dd').append('<li style="background-color:#f18a0c; border-color:#FFFFFF" class="ui-li-static ui-body-inherit ui-first-child"><div><p style="font-size:14px;">红蛇果</p><p style="font-size:10px;">4个，10斤，40元</p><p style="font-size:10px;"> <span>要求：</span><span style="white-space:pre-wrap">甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点甜一点</span> </p><div class="ui-grid-a"><div class="ui-block-a"> <a class="ui-btn ui-corner-all ui-mini" href="#page_8_2" data-rel="popup" data-position-to="window" data-transition="pop" style="background-color:#94252a; font-size:14px;" aria-haspopup="true" aria-owns="page_8_2" aria-expanded="false">修改</a> </div><div class="ui-block-b"> <a class="ui-btn ui-corner-all ui-mini" style="background-color:#94252a;font-size:14px;">删除</a> </div></div></div></li>');
}



/**
 * 点击订单历史记录
 */
function gotoDdlsjl() {
    if (checkLogin()) {
        samePageID('#page_11_1');
    } else {
        alert("未登录，请先登录");
        top.location = "index.html";
    }
}

/**
 * 点击我的个人信息
 */
function gotoWdgrxx() {
    if (checkLogin()) {
        samePageID('#page_12_1');
    } else {
        alert("未登录，请先登录");
        top.location = "index.html";
    }
}

/**
 * 获取水果评论列表
 * @param id 水果ID
 * @author ciano
 */
function getListFruitComment(id) {
    JKjsonP({
        ws: "customer/listFruitComment",
        parameter: {
            fruitId: id
        },
        sFunc: function(json) {
            if (json.result == "success") {
                var data = json.data;
                for (var i = 0; i < data.length; i++) {
                    var obj = data[i];
                    $('#listview_4_1').append('<li>' + '<a href="#page_7_1" data-transition="slide">' + '<div class="ui-grid-b" style="margin-left:-10px">' + '<div class="ui-block-a" style="margin-top:15px">' + '<p><img id="" src="' + obj.image + '" style="max-width:90px"></p>' + '</div>' + '<div class="ui-block-b" style="width:auto" >' + '<p style="font-size:16px">' + obj.name + '</p>' + '<p>' + obj.shop.shopName + '</p>' + obj.description + '</div>' + '<div class="ui-block-c" style="margin-top:10px;margin-left:-30px" align="right">' + '<p >' + obj.price + '</p>' + '<p style="font-size:12px"><span>挑:' + obj.grade + '</span><span> 速:' + obj.shop.sGrade + '</span></p>' + '<p>' + '' + '</p>' + '</div></div></a></li>');
                    $('#page_7_1_comment_list').append('<li>' + obj.comment + '</li>');
                }
            }
        },
        eFunc: function(XMLHttpRequest, textStatus, emessage) {
            alert(emessage);
        }
    });
}

/**
 * 跟据水果ID，如苹果，获取列表
 * @param id 水果ID
 * @author ciano
 */
function searchID(id) {
    $("#fruitList62 li").remove();
    var len = farr.length;

    for (var i = 0; i < len; i++) {
        var obj = window.farr[i];
        var classID = obj.classID;
        if (classID == id) {
            $("#fruitList62").append('<li style="margin-left:-10px; background-color:#f18a0c; border-color: #FFFFFF"><a href="" class="ui-btn" style="text-decoration:none;" id="' + obj.FruitID + '"  onClick="goFruit(this.id)"><div class="ui-grid-b"><div class="ui-block-a" style="margin-top:8px;width:20%;"> <img src="' + obj.image + '" style="max-width:90px"></div> <div class="ui-block-b" style="margin-left:50px;width:auto"><p style="font-size:20px; color:#fff">' + obj.FruitName + '</p><p style=" color:#fff"><span>挑</span>: <span style="color: #900">未定义</span></p><p style=" color:#fff">' + obj.price + '</p><p style=" color:#fff">周销量<span style="color: #900">未定义</span>斤 月销量<span style="color: #900">未定义</span>斤</p></div> </div></a> <a href="" class="ui-btn ui-btn-icon-notext ui-icon-plus ui-btn-a" style=" border-left-width:1px; box-sizing:border-box; height:100%; margin: 0; padding:0; position:absolute;right:0; top:0; width:2.5em; z-index: 2;background-color:#f18a0c;  border-left:none; border-color:#FFFFFF">加入购物车</a> </li>');
        }
    }

    $.mobile.changePage("#page_6_2", {
        transition: "slide"
    });

}

/**
 * 获取水果详情
 * @param id 水果ID
 * @author ciano
 */
function goFruit(id) {
    getListFruitComment(id);

    $.mobile.changePage("#page_7_1", {
        transition: "slide"
    });
}

function getFruitInfo(id) {
}



function reLogin() {
    alert("重新登录");
    localStorage.clear();
    top.location = "index.html";
}
function logout() {
    localStorage.clear();
    top.location = "index.html";
}
var currentPageID = "#page_3_1";
$(function() {
    $(document).on("swiperight",
    function(event) {
        $("#leftpanel").panel("open");
    });
    $(document).on("swipeleft",
    function(event) {
        $("#leftpanel").panel("close");
    });
});
function samePageID(newPageID) {
    if (currentPageID == newPageID) {
        $(":jqmData(role='panel')").panel('close');
    } else {
        currentPageID = newPageID;
    }
};
$(function() {
    $("body>[data-role='panel']").panel();
});

/**
 * 订单对象
 */
var orderObj = {
    shopId: -1
};








